<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../layui/css/layui.css" />
	</head>
	<body style="padding: 10px;">
		<form class="layui-form" action="" lay-filter="fromDevelopmentAddPlan">
			<input type="hidden" name="plState">
			<input type="hidden" name="chNo">
			<div class="layui-form-item">
				<label class="layui-form-label">客户编号</label>
				<div class="layui-input-block">
					<input  lay-verify="required" type="text" name="chName" disabled="disabled" placeholder="请输入客户名称" autocomplete="off" class="layui-input">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">开发日期</label>
				<div class="layui-input-block">
					  <input type="text" autocomplete="off" class="layui-input" id="development_date" name="plDate">
				</div>
			</div>
			<div class="layui-form-item">
			    <label class="layui-form-label">开发计划</label>
			    <div class="layui-input-block">
					<textarea name="plContent" required lay-verify="required" placeholder="请输入" class="layui-textarea"></textarea>
			    </div>
			  </div>
			<div class="layui-form-item">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit="" lay-filter="submitAddPlan">立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
		<script src="../layui/layui.js"></script>
		</body>
		<script type="text/javascript">
			layui.use(['jquery','form','laydate'],function(){
				var laydate = layui.laydate
				var form = layui.form
				var $ = layui.jquery
				  //执行一个laydate实例
				laydate.render({
				  elem: '#development_date' //指定元素
				});
				// form.render()
				form.val('fromDevelopmentAddPlan',{
					'chName':parent.row.chName,
					'chNo':parent.row.chNo,
					'plState':0
				})
				form.on('submit(submitAddPlan)',function(data){
					debugger
					$.ajax({
						data:data.field,
						dataType:'json',
						url:'http://localhost:8080/plan/addPlan',
						Type:'POST',
						success:function(backjson){
							layer.msg(backjson.msg)
							parent.table.reload('tblDevelopment')
							var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
							parent.layer.close(index); //再执行关闭 
						}
					})
					return false;
				})
				
				
			})
		</script>
</html>
